﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using BYSJ.Model;
namespace BYSJ.Web
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            //404页面
            routes.MapRoute(
             name: "Error",
              url: "Error404",
              defaults: new { controller = "Brow", action = "index404" }
          );

            //屏蔽低版本路由
            routes.MapRoute(
             name: "Brow",
              url: "Brow",
              defaults: new { controller = "Brow", action = "Index" }
          );

            //文件搜索路由
            routes.MapRoute(
             name: "search",
              url: "search",
              defaults: new { controller = "Search", action = "Index" }
          );

            //文件上传路由
            routes.MapRoute(
             name: "filrmoreinput",
              url: "filrmoreinput",
              defaults: new { controller = "FileInput", action = "Index" }
          );
            //退出登录路由
            routes.MapRoute(
             name: "longout",
              url: "longout",
              defaults: new { controller = "Logn", action = "longout" }
          );
            //密码修改
            routes.MapRoute(
             name: "xiugaiAccount",
              url: "xiugaiAccount",
              defaults: new { controller = "oneself", action = "xiugaiAccount" }
          );
            //头像上传处理
            routes.MapRoute(
             name: "touXiang",
              url: "touXiang",
              defaults: new { controller = "oneself", action = "touXiang" }
          );
            //学习视频跟踪路由
            routes.MapRoute(
             name: "addstudyVideo",
              url: "addshipin/study",
              defaults: new { controller = "File", action = "addVideoStudy" }
          );
            //个人中心路由
            routes.MapRoute(
             name: "oneself",
              url: "oneself/{Name}",
              defaults: new { controller = "oneself", action = "Index" }
          );
            //分享资源路由
            routes.MapRoute(
             name: "shard",
              url: "shard/{Name}/{pageindex}",
              defaults: new { controller = "Share", action = "Index" }
          );
            //模块文件下载路由
            routes.MapRoute(
               name: "Files",
                url: "Files/{Id}",
                defaults: new { controller = "File", action = "Files" }
            );
            //文件下载路由
            routes.MapRoute(
               name: "File",
                url: "File/{Name}",
                defaults: new { controller = "File", action = "Index" }
            );
            //视频播放路由
            routes.MapRoute(
               name: "shipinshows",
                url: "shipinshow/{Id}",
                defaults: new { controller = "Home", action = "ShiPinShow", Id = UrlParameter.Optional }
            );
            //视频显示路由
            routes.MapRoute(
               name: "shipin",
                url: "shipin/{Name}",
                defaults: new { controller = "Home", action = "ShiPin", Name = UrlParameter.Optional }
            );
            routes.MapRoute(
               name: "acount",
                url: "CreateAccount/{action}",
                defaults: new { controller = "CreateAccount", action = "CreateAccount" }
            );
            //回答处理路由
            routes.MapRoute(
               "questingadd",
               "showAnswer/addQuesting",
               new { controller = "huDong", action = "addQuesting" }
           );
            //增加子回答路由
            routes.MapRoute(
               "ahuifuadd",
               "add/addhuifu",
               new { controller = "huDong", action = "huifuAdd" }
           );
            //增加提问路由
            routes.MapRoute(
               "answeradd",
               "huDong/addAnswer",
               new { controller = "huDong", action = "addAnswer" }
           );
            routes.MapRoute(
                "questing",
                "showAnswer/{Name}/{Id}",
                new { controller = "huDong", action = "showAnswer" }
            );
            routes.MapRoute(
               "hudong",
               "huDong/{Name}/{pageindex}",
                 new { controller = "huDong", action = "HuDong", Name = UrlParameter.Optional, pageindex = "1" }
          );
            routes.MapRoute(
                 "Logn",
                 "{controller}/{action}/{Name}",
                   new { controller = "Logn", action = "Index", Name = UrlParameter.Optional }
            );
            //routes.MapRoute(
            // name: "Default",
            // url: "{controller}/{action}/{id}",
            // defaults: new { controller = " Home", action = "Index", id = UrlParameter.Optional }
        // );
        }
    }
}